package com.nenglai.common.task;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author kongdehui
 * @date 2021/06/07 14:40
 **/
public class TaskContainer {

    /**
     * 扫描存储任务
     */
    private Map<String, ITask<? extends ITaskHeader, ? extends ITaskBody>> tasks = new ConcurrentHashMap<>();


    public ITask<? extends ITaskHeader, ? extends ITaskBody> getTask(String name) {
        return tasks.get(name);
    }

    public void addTask(String key, ITask<? extends ITaskHeader, ? extends ITaskBody> task) {
        tasks.put(key, task);
    }

}
